package com.ibeeking.found.job.model;

import com.ibeeking.gmc.job.core.enums.ExecutorBlockStrategyEnum;
import com.ibeeking.gmc.job.core.enums.RouteStrategyEnum;
import com.ibeeking.gmc.job.core.glue.GlueTypeEnum;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 任务Info
 */
@Data
public class JobInfoModel extends BaseJobModel implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 任务执行CRON表达式，必填
     */
    @NotBlank(message = "任务执行CRON表达式必填")
    private String jobCron;

    /**
     * 任务描述
     */
    @NotBlank(message = "任务描述必填")
    private String jobDesc;

    /**
     * 负责人
     */
    @NotBlank(message = "负责人必填")
    private String author;

    /**
     * 报警邮件
     */
    private String alarmEmail;

    /**
     * 执行器路由策略
     */
    @NotNull(message = "执行器路由策略必填")
    private RouteStrategyEnum routeStrategyEnum;

    /**
     * jobName必填
     */
    @NotBlank(message = "jobName必填")
    private String jobName;

    /**
     * 执行器，任务参数
     */
    private String executorParam;

    /**
     * 阻塞处理策略
     */
    @NotNull(message = "阻塞处理策略必填")
    private ExecutorBlockStrategyEnum executorBlockStrategyEnum;

    /**
     * 任务执行超时时间，单位秒
     */
    private int executorTimeout = 4;

    /**
     * 失败重试次数
     */
    private int executorFailRetryCount = 1;

    /**
     * GLUE类型	#com.ibeeking.found.job.core.glue.GlueTypeEnum
     */
    private GlueTypeEnum glueTypeEnum = GlueTypeEnum.BEAN;

    /**
     * 子任务ID，多个逗号分隔
     */
    private String childJobId;

    /**
     * 调度状态：0-停止，1-运行
     */
    private int triggerStatus;
}
